package community.hospital.validation;

import cn.hutool.core.util.IdcardUtil;
import community.hospital.annotation.IsIdCard;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Author：ydj
 * @Date：2023/1/16 17:50
 */
public class IdCardValidation implements ConstraintValidator<IsIdCard,String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return IdcardUtil.isValidCard18(value);
    }
}
